package com.social.controller;

import com.social.pojo.Result;
import com.social.service.VolunteerRegisterService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @className: VolunteerRegisterController
 * @description: TODO 类描述
 * @author: XiaoXu
 * @date: 2022/12/11 20:06
 **/
@Api("VolunteerRegisterController")
@RestController
@RequestMapping("/volunteerRegister")
public class VolunteerRegisterController {

    @Resource
    private VolunteerRegisterService volunteerRegisterService;

    @GetMapping("/accept/{id}")
    public Result acceptApply(@PathVariable(value = "id") Long id){
        return volunteerRegisterService.acceptApply(id);

    }

    @GetMapping("/reject/{id}")
    public Result rejectApply(@PathVariable(value = "id") Long id){
        return volunteerRegisterService.rejectApply(id);
    }

    @GetMapping("/register/{id}")
    public Result register(@PathVariable("id") Long id , @RequestParam String letter){
        return volunteerRegisterService.register(id,letter);
    }

}
